﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"          
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:common="clr-namespace:Oxage.Common;assembly=Oxage.Controls"
  xmlns:c="clr-namespace:Oxage.Controls"
  xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna">

  <common:VisibilityConverter x:Key="VisibilityConverter" />

  <Style TargetType="{x:Type c:VectorSimulationCanvas}">
    <Setter Property="StrokeThickness" Value="2" />
    <Setter Property="Stroke" Value="White" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type c:VectorSimulationCanvas}">
          <Grid x:Name="RootElement">
            <Path Data="{TemplateBinding Geometry}" StrokeThickness="{TemplateBinding StrokeThickness}" Stroke="{TemplateBinding Stroke}" Stretch="Uniform" />
            <!--<Path Data="M0,0 L50,50 L100,150 L150,50 L50,50" StrokeThickness="2" Stroke="Yellow" Stretch="Uniform" />-->
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type c:RasterSimulationCanvas}">
    <!--<Setter Property="StrokeThickness" Value="2" />
    <Setter Property="Stroke" Value="White" />-->
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type c:RasterSimulationCanvas}">
          <Grid x:Name="RootElement">
            <wfi:WindowsFormsHost x:Name="host">
              <c:RasterSimulationControl />
            </wfi:WindowsFormsHost>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <Style x:Key="HeaderTextStyle" TargetType="{x:Type TextBlock}">
    <Setter Property="Foreground" Value="White" />
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="Margin" Value="2,0,0,4" />
  </Style>
  
  <Style x:Key="LabelTextStyle" TargetType="{x:Type TextBlock}">
    <Setter Property="Foreground" Value="White" />
    <Setter Property="FontWeight" Value="Normal" />
    <Setter Property="Margin" Value="0,0,0,0" />
  </Style>

  <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FF333333" />

	<VisualBrush x:Key="FilmBackgroundBrush" TileMode="Tile" Stretch="Uniform" Viewport="0,0,54,91" ViewportUnits="Absolute">
		<VisualBrush.Visual>
			<Path Fill="#FF1C1C1C" Stretch="Fill" Stroke="{x:Null}" Data="M176,287 C172.6862,287 170,289.68631 170,293 L170,309 C170,312.31369 172.6862,315 176,315 L184,315 C187.3138,315 190,312.31369 190,309 L190,293 C190,289.68631 187.3138,287 184,287 z M131,287 C127.68619,287 125,289.68632 125,293 L125,309 C125,312.31368 127.68619,315 131,315 L139,315 C142.3138,315 145,312.31369 145,309 L145,293 C145,289.68631 142.3138,287 139,287 z M86,287 C82.68626,287 80,289.68629 80,293 L80,309 C80,312.31371 82.68626,315 86,315 L94,315 C97.313739,315 100,312.31371 100,309 L100,293 C100,289.68629 97.313739,287 94,287 z M41,287 C37.686266,287 34.999988,289.6863 35.000004,293 L35.000004,309 C34.999988,312.3137 37.686266,315 41,315 L48.999996,315 C52.313778,315 55,312.3137 55,309 L55,293 C55,289.6863 52.313778,287 48.999996,287 z M176,16.999998 C172.68623,17.000006 170,19.686317 170,23 L170,39 C170,42.313692 172.68624,45 176,45 L184,45 C187.31376,45 190,42.313692 190,39 L190,23 C190,19.686317 187.31377,17.000006 184,16.999998 z M131,16.999998 C127.68623,17.000006 125,19.686327 125,23 L125,39 C125,42.313683 127.68624,45 131,45 L139,45 C142.31376,45 145,42.313692 145,39 L145,23 C145,19.686317 142.31377,17.000006 139,16.999998 z M86,16.999998 C82.686296,17.000006 80,19.686304 80,23 L80,39 C80,42.313705 82.686303,45 86,45 L94,45 C97.313696,45 100,42.313705 100,39 L100,23 C100,19.686304 97.313704,17.000006 94,16.999998 z M41,16.999998 C37.686327,17.000006 34.999988,19.686294 35.000004,23 L35.000004,39 C34.999988,42.313715 37.686334,45 41,45 L48.999992,45 C52.313747,45 55,42.313695 55,39 L55,23 C55,19.686314 52.313754,17.000006 48.999992,16.999998 z M0,0 L226,0 226,16.999998 221,16.999998 C217.68623,17.000006 215,19.686317 215,23 L215,39 C215,42.313692 217.68624,45 221,45 L226,45 226,287 221,287 C217.6862,287 215,289.68631 215,293 L215,309 C215,312.31369 217.6862,315 221,315 L226,315 226,332 0,332 0,315 3.9999973,315 C7.3137656,315 10.000003,312.3137 9.9999988,309 L9.9999988,293 C10.000003,289.6863 7.3137656,287 3.9999973,287 L0,287 0,45 3.9999973,45 C7.313723,45 10.000003,42.313694 9.9999988,39 L9.9999988,23 C10.000003,19.686315 7.3137301,17.000006 3.9999973,16.999998 L0,16.999998 z" Margin="0,160,-840,-12" HorizontalAlignment="Right" />
		</VisualBrush.Visual>
	</VisualBrush>

	<VisualBrush x:Key="ChessboardBackgroundBrush" ViewportUnits="Absolute" Viewport="0,0,25,25" TileMode="Tile">
		<VisualBrush.Visual>
			<Grid Width="16" Height="16" Background="#FF2A2A2A">
				<Rectangle Width="8" Height="8" Fill="#FF2D2D2D" VerticalAlignment="Top" HorizontalAlignment="Left" />
				<Rectangle Width="8" Height="8" Fill="#FF2D2D2D" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
			</Grid>
		</VisualBrush.Visual>
	</VisualBrush>

	<Style x:Key="FilmListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
		<Setter Property="Width" Value="60" />
		<Setter Property="Height" Value="50" />
		<Setter Property="Padding" Value="0" />
	</Style>

	<!-- MenuItemStyle -->
	<Style TargetType="{x:Type MenuItem}">
		<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="White"/>
		<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
		<Style.Triggers>
			<Trigger Property="Role" Value="TopLevelHeader">
				<Setter Property="Margin" Value="0,1,0,1"/>
				<Setter Property="Padding" Value="6,3,6,3"/>
				<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
			</Trigger>
			<Trigger Property="Role" Value="TopLevelItem">
				<Setter Property="Margin" Value="0,1,0,1"/>
				<Setter Property="Padding" Value="6,3,6,3"/>
				<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
			</Trigger>
			<Trigger Property="Role" Value="SubmenuHeader">
				<Setter Property="DockPanel.Dock" Value="Top"/>
				<Setter Property="Padding" Value="0,2,0,2"/>
				<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
			</Trigger>
			<Trigger Property="Role" Value="SubmenuItem">
				<Setter Property="DockPanel.Dock" Value="Top"/>
				<Setter Property="Padding" Value="0,2,0,2"/>
			</Trigger>
		</Style.Triggers>
	</Style>

	<!-- MenuStyle -->
	<Style TargetType="{x:Type Menu}">
		<Setter Property="Background" Value="#3a3a3a"/>
		<Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
		<Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
		<Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
		<Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
		<Setter Property="Foreground" Value="White"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Menu}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
						<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<PathGeometry x:Key="Checkmark" Figures="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z"/>
	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition SharedSizeGroup="MenuItemIconColumnGroup" MinWidth="17" Width="Auto"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
					<ColumnDefinition Width="14"/>
				</Grid.ColumnDefinitions>
				<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
				<Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Hidden" Data="{StaticResource Checkmark}"/>
				<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True"/>
				<TextBlock Margin="5,2,0,2" x:Name="InputGestureText" Grid.Column="2" DockPanel.Dock="Right" Text="{TemplateBinding InputGestureText}"/>
			</Grid>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
		<Setter Property="ClickMode" Value="Hover"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<DockPanel SnapsToDevicePixels="true" Background="Transparent">
						<Rectangle Fill="Transparent" x:Name="R1" Width="1" DockPanel.Dock="Right"/>
						<Rectangle Fill="Transparent" x:Name="B1" Height="1" DockPanel.Dock="Bottom"/>
						<Rectangle Fill="Transparent" x:Name="L1" Width="1" DockPanel.Dock="Left"/>
						<Rectangle Fill="Transparent" x:Name="T1" Height="1" DockPanel.Dock="Top"/>
						<ContentPresenter HorizontalAlignment="Center" Margin="2,2,2,2" x:Name="ContentContainer" VerticalAlignment="Center"/>
					</DockPanel>
					<ControlTemplate.Triggers>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="Fill" TargetName="R1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
							<Setter Property="Fill" TargetName="B1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
							<Setter Property="Fill" TargetName="L1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
							<Setter Property="Fill" TargetName="T1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
							<Setter Property="Margin" TargetName="ContentContainer" Value="3,3,1,1"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
	<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
	<Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
	<Style x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
		<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
		<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ScrollViewer}">
					<Grid SnapsToDevicePixels="true">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="*"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Border Grid.Column="0" Grid.Row="1">
							<ScrollContentPresenter Margin="{TemplateBinding Padding}"/>
						</Border>
						<RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Grid.Column="0" Grid.Row="0" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
							<RepeatButton.Visibility>
								<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
									<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
								</MultiBinding>
							</RepeatButton.Visibility>
							<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource UpArrow}"/>
						</RepeatButton>
						<RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Grid.Column="0" Grid.Row="2" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
							<RepeatButton.Visibility>
								<MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
									<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
									<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
								</MultiBinding>
							</RepeatButton.Visibility>
							<Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource DownArrow}"/>
						</RepeatButton>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
			<DockPanel>
				<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
				<Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}"/>
				<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
				<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" Focusable="false">
					<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
						<Border x:Name="SubMenuBorder" Background="#3a3a3a" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" BorderThickness="1">
							<ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
								<ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
							</ScrollViewer>
						</Border>
					</Microsoft_Windows_Themes:SystemDropShadowChrome>
				</Popup>
			</DockPanel>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="IsSuspendingPopupAnimation" Value="true">
				<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
			</Trigger>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
			</Trigger>
			<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
				<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
				<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
			<DockPanel>
				<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
				<Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}"/>
				<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
			</DockPanel>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="White"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
	<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
		<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition SharedSizeGroup="MenuItemIconColumnGroup" MinWidth="17" Width="Auto"/>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
					<ColumnDefinition Width="14"/>
				</Grid.ColumnDefinitions>
				<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
				<Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Hidden" Data="{StaticResource Checkmark}"/>
				<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True"/>
				<Path Fill="{TemplateBinding Foreground}" Margin="4,0,6,0" VerticalAlignment="Center" Grid.Column="3" Data="{StaticResource RightArrow}" DockPanel.Dock="Right"/>
				<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3" Focusable="false">
					<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
						<Border x:Name="SubMenuBorder" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" BorderThickness="1">
							<ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
								<ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
							</ScrollViewer>
						</Border>
					</Microsoft_Windows_Themes:SystemDropShadowChrome>
				</Popup>
			</Grid>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="IsSuspendingPopupAnimation" Value="true">
				<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
			</Trigger>
			<Trigger Property="Icon" Value="{x:Null}">
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
				<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
			</Trigger>
			<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
				<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
				<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
			</Trigger>
			<Trigger Property="IsHighlighted" Value="true">
				<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

	<!-- ToolbarStyle -->
	<LinearGradientBrush x:Key="ToolBarHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#FAF9F5" Offset="0"/>
		<GradientStop Color="#EBE7E0" Offset="0.5"/>
		<GradientStop Color="#C0C0A8" Offset="0.9"/>
		<GradientStop Color="#A3A37C" Offset="1"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="ToolBarToggleButtonVerticalBackground" EndPoint="1,0" StartPoint="0,0">
		<GradientStop Color="#EFEEEB" Offset="0"/>
		<GradientStop Color="#E1E1DA" Offset="0.5"/>
		<GradientStop Color="#98987E" Offset="1"/>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ToolBarButtonHover" Color="#C1D2EE"/>
	<SolidColorBrush x:Key="ToolBarGripper" Color="#C1BEB3"/>

	<Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Background" Value="{StaticResource ToolBarToggleButtonVerticalBackground}"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" CornerRadius="0,0,3,3">
						<Canvas HorizontalAlignment="Right" Margin="2,7,2,2" VerticalAlignment="Bottom" Width="7" Height="6" SnapsToDevicePixels="true">
							<Path Stroke="White" Data="M 1.5 1 L 1.5 6"/>
							<Path Stroke="{TemplateBinding Foreground}" Data="M 0.5 0 L 0.5 5"/>
							<Path Fill="White" Data="M 3.5 0.5 L 7 3.5 L 4 6.5 Z"/>
							<Path Fill="{TemplateBinding Foreground}" Data="M 3 -0.5 L 6 2.5 L 3 5.5 Z"/>
						</Canvas>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
						</Trigger>
						<Trigger Property="IsKeyboardFocused" Value="true">
							<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<LinearGradientBrush x:Key="ToolBarVerticalBackground" EndPoint="1,0" StartPoint="0,0">
		<GradientStop Color="#FAF9F5" Offset="0"/>
		<GradientStop Color="#EBE7E0" Offset="0.5"/>
		<GradientStop Color="#C0C0A8" Offset="0.9"/>
		<GradientStop Color="#A3A37C" Offset="1"/>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="ToolBarToggleButtonHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#EFEEEB" Offset="0"/>
		<GradientStop Color="#E1E1DA" Offset="0.5"/>
		<GradientStop Color="#98987E" Offset="1"/>
	</LinearGradientBrush>
	<Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Background" Value="{StaticResource ToolBarToggleButtonHorizontalBackground}"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" CornerRadius="0,3,3,0">
						<Canvas HorizontalAlignment="Right" Margin="7,2,2,2" VerticalAlignment="Bottom" Width="6" Height="7" SnapsToDevicePixels="true">
							<Path Stroke="White" Data="M 1 1.5 L 6 1.5"/>
							<Path Stroke="{TemplateBinding Foreground}" Data="M 0 0.5 L 5 0.5"/>
							<Path Fill="White" Data="M 0.5 4 L 6.5 4 L 3.5 7 Z"/>
							<Path Fill="{TemplateBinding Foreground}" Data="M -0.5 3 L 5.5 3 L 2.5 6 Z"/>
						</Canvas>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
						</Trigger>
						<Trigger Property="IsKeyboardFocused" Value="true">
							<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<SolidColorBrush x:Key="ToolBarSubMenuBackground" Color="#FCFCF9"/>
	<SolidColorBrush x:Key="ToolBarMenuBorder" Color="#8A867A"/>
	<Style x:Key="ToolBarThumbStyle" TargetType="{x:Type Thumb}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Border SnapsToDevicePixels="True" Background="Transparent" Padding="{TemplateBinding Padding}">
						<Rectangle>
							<Rectangle.Fill>
								<DrawingBrush TileMode="Tile" Viewbox="0,0,4,4" ViewboxUnits="Absolute" Viewport="0,0,4,4" ViewportUnits="Absolute">
									<DrawingBrush.Drawing>
										<DrawingGroup>
											<GeometryDrawing Brush="White" Geometry="M 1 1 L 1 3 L 3 3 L 3 1 z"/>
											<GeometryDrawing Brush="{StaticResource ToolBarGripper}" Geometry="M 0 0 L 0 2 L 2 2 L 2 0 z"/>
										</DrawingGroup>
									</DrawingBrush.Drawing>
								</DrawingBrush>
							</Rectangle.Fill>
						</Rectangle>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Cursor" Value="SizeAll"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="ToolBarStyle" TargetType="{x:Type ToolBar}">
		<Setter Property="Background" Value="{StaticResource ToolBarHorizontalBackground}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToolBar}">
					<Grid Margin="3,1,1,1" x:Name="Grid" SnapsToDevicePixels="true">
						<Grid HorizontalAlignment="Right" x:Name="OverflowGrid">
							<ToggleButton FocusVisualStyle="{x:Null}" x:Name="OverflowButton" Style="{StaticResource ToolBarHorizontalOverflowButtonStyle}" IsEnabled="{TemplateBinding HasOverflowItems}" ClickMode="Press" IsChecked="{Binding Path=IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
							<Popup x:Name="OverflowPopup" AllowsTransparency="true" IsOpen="{Binding Path=IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" StaysOpen="false" Focusable="false">
								<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
									<Border Background="{StaticResource ToolBarSubMenuBackground}" BorderBrush="{StaticResource ToolBarMenuBorder}" BorderThickness="1">
										<ToolBarOverflowPanel FocusVisualStyle="{x:Null}" Margin="2" x:Name="PART_ToolBarOverflowPanel" Focusable="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" WrapWidth="200"/>
									</Border>
								</Microsoft_Windows_Themes:SystemDropShadowChrome>
							</Popup>
						</Grid>
						<Border Margin="0,0,11,0" x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,3,3,3" Padding="{TemplateBinding Padding}">
							<Border.Background>
								<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
									<GradientStop Color="#FF404040" Offset="0"/>
									<GradientStop Color="#FF424142" Offset="0.504"/>
									<GradientStop Color="#FF575657" Offset="0.893"/>
									<GradientStop Color="#FF313031" Offset="1"/>
								</LinearGradientBrush>
							</Border.Background>
							<DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
								<Thumb Margin="-3,-1,0,0" x:Name="ToolBarThumb" Style="{StaticResource ToolBarThumbStyle}" Width="10" Padding="6,5,1,6"/>
								<ContentPresenter HorizontalAlignment="Center" Margin="4,0,4,0" x:Name="ToolBarHeader" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header"/>
								<ToolBarPanel Margin="0,1,2,2" x:Name="PART_ToolBarPanel" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsItemsHost="true"/>
							</DockPanel>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsOverflowOpen" Value="true">
							<Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false"/>
						</Trigger>
						<Trigger Property="Header" Value="{x:Null}">
							<Setter Property="Visibility" TargetName="ToolBarHeader" Value="Collapsed"/>
						</Trigger>
						<Trigger Property="ToolBarTray.IsLocked" Value="true">
							<Setter Property="Visibility" TargetName="ToolBarThumb" Value="Collapsed"/>
						</Trigger>
						<Trigger Property="HasDropShadow" SourceName="OverflowPopup" Value="true">
							<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
							<Setter Property="SnapsToDevicePixels" TargetName="Shdw" Value="true"/>
							<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
						</Trigger>
						<Trigger Property="Orientation" Value="Vertical">
							<Setter Property="Margin" TargetName="Grid" Value="1,3,1,1"/>
							<Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource ToolBarVerticalOverflowButtonStyle}"/>
							<Setter Property="Height" TargetName="ToolBarThumb" Value="10"/>
							<Setter Property="Width" TargetName="ToolBarThumb" Value="Auto"/>
							<Setter Property="Margin" TargetName="ToolBarThumb" Value="-1,-3,0,0"/>
							<Setter Property="Padding" TargetName="ToolBarThumb" Value="5,6,6,1"/>
							<Setter Property="Margin" TargetName="ToolBarHeader" Value="0,0,0,4"/>
							<Setter Property="Margin" TargetName="PART_ToolBarPanel" Value="1,0,2,2"/>
							<Setter Property="DockPanel.Dock" TargetName="ToolBarThumb" Value="Top"/>
							<Setter Property="DockPanel.Dock" TargetName="ToolBarHeader" Value="Top"/>
							<Setter Property="HorizontalAlignment" TargetName="OverflowGrid" Value="Stretch"/>
							<Setter Property="VerticalAlignment" TargetName="OverflowGrid" Value="Bottom"/>
							<Setter Property="Placement" TargetName="OverflowPopup" Value="Right"/>
							<Setter Property="Margin" TargetName="MainPanelBorder" Value="0,0,0,11"/>
							<Setter Property="Background" Value="{StaticResource ToolBarVerticalBackground}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>